﻿
// Condition: 3. Write a method that returns the last digit of given integer as an English word. Examples: 512 - "two"; 1024 - "four"; 12309 - "nine".


using System;



class LastDigitName
{
    // method that return name of last digit
    static string DigitName(int number)
    {
        // separate last digit from number
        int lastDigit = number%10;

        // return name of digit
        switch (lastDigit)
        {
                
            case 1: return "one";
            case 2: return "two";
            case 3: return "three";
            case 4: return "four";
            case 5: return "five";
            case 6: return "six";
            case 7: return "seven";
            case 8: return "eight";
            case 9: return "nine";
        }
        return "zero";
    }

    static void Main(string[] args)
    {
        Console.Write("Enter one integer: ");
        int n = int.Parse(Console.ReadLine());
        Console.WriteLine("The last digit of number {0} is: {1}.",n,DigitName(n));
    }
}

